<?php $post = $this->get('post');?>
<div class="x-list-title">
	<table width="100%" border="0" height="100%">
	<tr>
		<td align="left">
			<h2><?php _e($post['title']);?>
			</h2>
		</td>
		<td align="right">	
				<div class="x-list-options">
					<?php _e( tpl_search_form(baseUrl()."/Crm/Contact/Search", "#Crm/Contact/Search") );?>

					<div class="x-options-container">
						<a class="x-button"> Giao dịch <span>&#9660;</span></a>
						<div class="x-options">
							<a onclick="location.href='mailto:'+$(this).find('textarea').get('value')" class="x-options-item">Gửi email
								<textarea style='display:none'><?php _e($post['title'])?> <<?php _e($post['email'])?>></textarea>
							</a>
							<a onclick="load_inframe('<?php _baseUrl();?>/Crm/Transaction/Smscontact?ID[]=<?php _e($post['ID'])?>',{auto_hidden:true,title: 'Giao dịch SMS'})" class="x-options-item">Gửi SMS</a>
						</div>
					</div>				

					<div class="x-options-container">
						<a class="x-button"> Tác vụ khác <span>&#9660;</span></a>
						<div class="x-options">
							<a href="#Crm/Contact/Edit?ID=<?php _e(get('ID'));?>" class="x-options-item">Sửa liên hệ</a>
							<a onclick="module_delete('<?php _baseUrl();?>/Crm/Contact/Delete?ID[]=<?php _e(get('ID'));?>')" class="x-options-item">Xóa liên hệ</a>
							<a href="#Crm/Contact/Add" class="x-options-item">Liên hệ mới</a>
						</div>
					</div>
				</div>
		</td>
	</tr>
	</table>	
</div>
<div class="x-info-container">
	<table width="100%" border="0" class="x-info" cellspacing="0">
	<tr>
		<td colspan="4" align="right" class="x-info-top">
			<span class="tl">Thông tin chi chung</span>
			<span class="tr">Cập nhật lần cuối lúc <?php _e( show_date(DATETIME_FORMAT,$post['date_updated']) );?> bởi <?php _e(get_user_link( $post['updated_by_id'],$post['updated_by_name'],$post['updated_is_deleted']) );?></a></span>
		</td>
	</tr>
	<tr>
		<td class="x-info-label" nowrap="nowrap">
			Mã
		</td>
		<td class="x-info-content">
			<span class="code"><?php _e( $post['code'] );?></span>
		</td>
		<td class="x-info-label" nowrap="nowrap">
			Tên liên hệ
		</td>
		<td class="x-info-content">
			<?php _e($post['title']);?>
		</td>	

	</tr>
	<tr>	
		<td class="x-info-label">
			Công ty
		</td>
		<td class="x-info-content">
			<a href="#Crm/Customer/View?ID=<?php _e( $post['customer_id'] );?>">
				<?php _e( $post['customer_name'] );?></a>
		</td>
		<td class="x-info-label" nowrap="nowrap">
			Chức vụ
		</td>
		<td class="x-info-content">
			<?php _e( $post['jobtitle'] );?>						
		</td>	
	</tr>
	<tr>	
		<td class="x-info-label">
			Người đầu mối
		</td>
		<td class="x-info-content">
			<?php _e( $post['person_contact'] );?>
		</td>
		<td class="x-info-label" nowrap="nowrap">
			Địa chỉ
		</td>
		<td class="x-info-content">
			<?php _e( $post['address'] );?>						
		</td>	
	</tr>
	<tr>	
		<td class="x-info-label">
			Email
		</td>
		<td class="x-info-content">
			<?php _e( show_email($post['title'],$post['email']) );?>
		</td>
		<td class="x-info-label" nowrap="nowrap">
			Website
		</td>
		<td class="x-info-content">
		<?php _e( $post['website'] );?>		
		</td>	
	</tr>
	<!--OTHER-->
	<tr>	
		<td class="x-info-label">
			Di động
		</td>
		<td class="x-info-content">
			<?php _e( $post['mobile'] );?>
		</td>
		<td class="x-info-label" nowrap="nowrap">
			Cố định
		</td>
		<td class="x-info-content">
		<?php _e( $post['phone'] );?>						
	</tr>
	<tr>	
		<td class="x-info-label">
			Ngày sinh
		</td>
		<td class="x-info-content">
			<?php _e( show_date(DATE_FORMAT,$post['birthday']) );?>
		</td>
		<td class="x-info-label" nowrap="nowrap">
			Chăm sóc
		</td>
		<td class="x-info-content">
		<?php _e( get_user_link($this->get('care')) );?>						
	</tr>
	
	<tr>
		<td class="x-info-label x-info-label-last">
			Mô tả
		</td>
		<td colspan="3" class="x-info-content">
			<?php _e( $post['desc'] );?>
		</td>
	</tr>
	<tr>
		<td class="x-info-label x-info-label-last">
			Đính kèm
		</td>
		<td colspan="3" class="x-info-content">
		<?php $a=array();?>
		<?php foreach( $this->get('files') as $f ):?>
		<?php show_thumb( $f, baseUrl()."/Crm/Contact/File?ID={$f['ID']}");?>
		<?php endforeach;?>	
		</td>
	</tr>

</table>
</div>
